//
//  VersionManager.m
//  nonghubao
//
//  Created by Fenrir on 13-8-6.
//  Copyright (c) 2013年 Chongqing Nonghubao Co., Ltd. All rights reserved.
//

#import "VersionManager.h"
#import "Config.h"


@implementation VersionManager
@synthesize versionInfo = _versionInfo;


- (id)init
{
    self = [super init];
    if (self) {
        
        
    }
    return self;
}

+ (NSDictionary *)startVersionChecking:(NSInteger)curVersion
{
    JSONRequest *versionRequest = [[JSONRequest alloc] initWithURLString:_JSON_URL_ACCOUNT_CLIENT_VERSION_CHECK];
    
    [versionRequest setValue:[NSString stringWithFormat:@"%d",1] forParameter:@"type"];
    [versionRequest setValue:[NSString stringWithFormat:@"%d",curVersion] forParameter:@"sequence"];
    NSDictionary *dict = [versionRequest synchronous];

    if ([dict[@"status"] integerValue] == 1) {
        
        return dict[@"data"];
        
    }
    else {
        return nil;
    }
}

@end
